Lua/Client/Game/Functions/FireEvent
From JC2-MP Documentation
Returns | none |
---|---|
Prototype | Game:FireEvent(string) |
Description | This triggers a JC2 event to occur. This is a very powerful function; you can trigger any event in the game, such as the dish doors or stronghold doors opening. There is likely a way to launch the rocket and disable the EMP tower as well. |
Using DLC Parachutes
To give the player the Chaos chute (and now the newly released 5 extra DLC chutes) fire the following game events:
Chaos chute: parachute03.pickup.execute
Daredevil chute: parachute02.pickup.execute
Camo chute: parachute04.pickup.execute
Tiger chute: parachute05.pickup.execute
Scorpion chute: parachute06.pickup.execute
Firestorm chute: parachute07.pickup.execute
Once you fire these events on the client, they will give the local player the parachute. Note: If the player is already parachuting when this event is fired, the parachute will be invisible until it is closed and reopened.
Finding events
To find the event names, you must extract them from the game's mission files yourself.
Using Gibbed's tools
Download Gibbed's Avalanche Tools, and use ArchiveViewer to extract the pcx.tab, where x is a number from 1-4, (from \steamapps\Just Cause 2\archives_win32\). Then use SmallUnpack on the resulting .blz files (drag the .blz onto the SmallUnpack file). Go into a mission's folder, and use BinConvert on the .bl file (same process as SmallUnpack, drag it) to get an XML file. There, you can use CTRL+F to search for the events.
Some events look like this: msy.f2m06.obj.complete, other, complicated ones, look like this: t{spsv({046DE310-DF86-4D1C-B5DB-556BA134876F})}::truck.entered. Note that these events shown here do not do anything.
An example mission file will be called f2m06.blz. This is a Ular Boys mission. (it is the Lost Island mission)
If you're looking for a specific mission file, note that the missions follow a naming syntax: f1 is Roaches, f2 is Ular Boys, f3 is Reapers (please note that this rule has a few exceptions, e.g. the rocket mission and the mission involving Captain Singh, which appear to be Reaper and Ular missions whilst they are actually Ular and Roach missions, respectively), and mn, where n is a number ranging from 01 to around 15, is the mission number. The mission number does not follow any clear rule.
If the event you have found does nothing, do not be disheartened. The vast majority of events you find won't do anything. If you're not certain that it does nothing, yet you cannot see anything happening, make sure you are in the area that it has an effect on.
Key mission files (Agency missions/story missions) are simply named km01 through km08.
Known missions
pc2\sequences\unknown\f2m04 seems to refer to a mission in which a train is involved (this is possibly a scrapped mission)
pc2\missions\factionmissions\f2m05 is the mission in which you clear workmen off of a sacred Ular burial site.
pc2\missions\factionmissions\f2m06 is the Lost Island mission.
pc2\missions\factionmissions\f2m07 is the mission in which you steal a sample (presumably from Tasik)
pc2\missions\factionmissions\f2m08 is the mission in which you find and kill Lee Ho Fook.
pc2\missions\factionmissions\f3m04 is Fry me to the Moon; the mission where you intercept a rocket launch.
Examples
Hiding the crosshair
HideCrosshair = function() Game:FireEvent("gui.aim.hide") end Events:Subscribe("Render", HideCrosshair)
Disabling the grappling hook
DisableHook = function() Game:FireEvent("ply.grappling.disable") end Events:Subscribe("GameLoad", DisableHook)
Disabling the parachute
DisableChute = function() Game:FireEvent("ply.parachute.disable") end Events:Subscribe("GameLoad", DisableChute)
Opening stronghold doors
class 'StrongholdDoors' function StrongholdDoors:__init() self.strongholds = { Vector3( -3000.255,245.3961,12743.33 ), Vector3( 557.3547,1179.563,-7246.511 ), Vector3( 11577.3,228.0705,-9371.375 ), Vector3( -3392.792,190.8312,8814.813 ), Vector3( -10699.12,381.8536,11071.68 ), Vector3( 9078.66,202.9968,1485.909 ), Vector3( -14871.19,196.2978,-2944.443 ) } self.timer = Timer() self.PTEvent = Events:Subscribe( "PostTick", self, self.PT ) end function StrongholdDoors:PT() if self.timer:GetMilliseconds() <= 1000 then return end self.timer:Restart() local lp_pos = LocalPlayer:GetPosition() local sqrt = math.sqrt for k,v in pairs(self.strongholds) do local dist = lp_pos:DistanceSqr( v ) if dist < 250000 then if k == 1 then Game:FireEvent( "t{go500.01({967466FA-4C87-422A-ACF5-042B67E922B5})}::fadeOutGate" ) return elseif k == 2 then Game:FireEvent( "t{go500.01({9695B812-73C4-4D86-86FF-AEC430816869})}::fadeOutGate" ) return elseif k == 3 then -- ular Game:FireEvent( "t{go500.01({F7CD6FAE-EFCE-4CA4-A1C4-6944D228139F})}::fadeOutGate" ) return elseif k == 4 then Game:FireEvent( "t{go500.01({FD92A809-89AC-4D64-BC1C-335FD22F5B83})}::fadeOutGate" ) return elseif k == 5 then -- reapers Game:FireEvent( "t{go500.01({927DC663-1EAA-4D87-810F-36F8581CBE7D})}::fadeOutGate" ) Game:FireEvent( "t{go500.01({8EB05652-74A1-4DA6-B24F-E77803AB4B6B})}::fadeOutGate" ) return elseif k == 6 then Game:FireEvent( "t{go500.01({EC54E85D-45ED-46A8-8E31-3B32DEE1D5FC})}::fadeOutGate" ) return else Game:FireEvent( "t{go500.01({86D114AF-77FD-44CC-B861-5F6C77ED03A0})}::fadeOutGate" ) return end end end end SDoors = StrongholdDoors()
Partial reference
Note: These were tested under no particular conditions, just in a random location. Some labelled "nothing" may do something under special conditions.
- bm.closemeny // Nothing
- bm.cutscene // Extraction cutscene
- bm.disable // Nothing
- bm.enable // Nothing
- bm.enableextractions // Displays a popup with title bar: "Extraction Unlocked"; empty otherwise
- bm.extraction.go // Extremely unstable -- avoid use, creates large lag-spike, sometimes crashes, but will open PDA, placing the player at a random location, then they will freefall at that location. Upon further use, it can also trigger Sloth Demon lines, and cause loading screens.
- bm.giveflare // Displays a popup with title bar: "Black Market Unlocked"; empty otherwise
- bm.heavydrop.paid // Nothing
- bm.loadcheckpoint.go // Kicks to JC-MP main menu
- bm.openmeny // Nothing, even if this is a typo, bm.openmenu does nothing either.
- bm.savecheckpoint.go
- bm.switchvoice
- cot.startSequenceMissionComplete
- demo.start
- dialogmanager.reset
- explosive.c4.detonated
- game.demolition.killed
- game.elite.killed
- game.ninja.killed
- government.airvehicle.destroyed
- government.landvehicle.destroyed
- government.seavehicle.destroyed
- gsy.activity.type%.02d
- gsy.activity.type24
- gsy.activity.type25
- gsy.activity.type26
- gsy.air_limbo.bridge_passed
- gsy.chaos.changed
- gsy.completion.increased
- gsy.dripfeed.disable
- gsy.dripfeed.enable
- gsy.exit.settlement
- gsy.heatChange.combatNone
- gsy.heatChange.combatSearch
- gsy.heatChange.combatUndetected
- gsy.heatChange.noneCombat
- gsy.heatChange.noneSearch
- gsy.heatChange.noneUndetected
- gsy.heatChange.searchCombat
- gsy.heatChange.searchNone
- gsy.heatChange.searchUndetected
- gsy.heatChange.undetectedCombat
- gsy.heatChange.undetectedNone
- gsy.heatChange.undetectedSearch
- gsy.notice41.unlock
- gsy.notice69.unlock
- gsy.object_destroyed
- gsy.playerVelocity
- gsy.scorpion.killed
- gsy.top_of_the_world.achived
- gui.aim.hide
- gui.aim.show
- gui.anarkevent
- gui.benchmark.complete
- gui.benchmark.pause
- gui.benchmark.show
- gui.blackmarket.finished
- gui.blackmarket.show
- gui.capture.xmb.upload.done
- gui.capture.youtube.upload.done
- gui.challenge.checkpoint.bonus
- gui.challenge.checkpoint.complete
- gui.challenge.hide
- gui.challenge.info
- gui.challenge.show
- gui.challenge.started
- gui.creditscreen.show
- gui.crosshair.hide
- gui.crosshair.show
- gui.cutscene
- gui.cutscene.allowskip
- gui.cutscene.loadingscreen
- gui.disarm.complete
- gui.disarm.fail
- gui.disarm.show
- gui.endscreen.show
- gui.flare.crosshair.hide
- gui.flare.crosshair.show
- gui.force.show.start.screen
- gui.frontend.show
- gui.game.completed
- gui.gameovermenu.show
- gui.hud.hide // This and possibly other gui events cause the Game State to change. Keep this in mind while using.
- gui.hud.hide.force
- gui.hud.reset
- gui.hud.show
- gui.hud.show.force
- gui.intelligencefile.show
- gui.loadingscreen.show
- gui.mainmenu.hide
- gui.mainmenu.show
- gui.menu.hide
- gui.mercenarymode.show
- gui.militaryoppression.off
- gui.militaryoppression.on
- gui.minimap.hide
- gui.minimap.show
- gui.parachutebutton.close
- gui.parachutebutton.open
- gui.pausemenu.show
- gui.pda.disable
- gui.pda.disablemanualopen
- gui.pda.enable
- gui.pda.forceopen
- gui.pda.show
- gui.profile.signin.change
- gui.quitgamedialogue.show.force
- gui.saveload.disable
- gui.saveload.enable
- gui.savemanager.autosave.saved
- gui.savemanager.checkpoint.saved
- gui.savemanager.delete.failed
- gui.savemanager.insufficientspace
- gui.savemanager.load.failed
- gui.savemanager.nospaceleft
- gui.savemanager.save.failed
- gui.savemanager.settingsfile.fail
- gui.savemanager.state.changed
- gui.savemanager.storage.changed
- gui.savemanager.storage.lost
- gui.signalstrength.hide
- gui.signalstrength.show
- gui.sniper.off
- gui.sniper.stage1
- gui.sniper.stage2
- gui.storage.notenoughspaceatboot
- gui.storage.warning
- gui.subtitle.hide
- gui.subtitle.show
- gui.transmission.hide
- gui.transmission.show
- gui.tutorial.hide
- gui.tutorial.pause
- gui.tutorial.resume
- gui.update.dlc.list
- gui.weapon.raiseaim
- heat.helicopter.spawn
- heat.level.0
- heat.level.1
- heat.level.2
- heat.level.3
- heat.level.4
- heat.level.5
- heat.level.increased
- km01.pipes.01.explosion // blows up pipe at Kem Gunung Dataran Tinggi
- km01.pipes.02.explosion // blows up another pipe at Kem Gunung Dataran Tinggi
- km025.tutorial.01
- km025.tutorial.01.b.start
- km04.ninja.killed
- km07.panay.accuracy
- metric.settlement.complete
- metric.settlement.unlock
- msy.challenge.endgui
- msy.challenge.startgui
- msy.collectblackbox.completed
- msy.collectdrugdrop.completed
- msy.collectskull.completed
- msy.f1.popular
- msy.f2.popular
- msy.f3.popular
- msy.factionmission.completed
- msy.factiontask.completed
- msy.keymission.completed
- msy.km01.completed
- msy.km01Obj01.activated
- msy.km02.completed
- msy.km02Obj08.checkpoint
- msy.km03.completed
- msy.km04.completed
- msy.km04Obj02.checkpoint
- msy.km05.completed
- msy.km06.completed
- msy.km06Obj11.activated
- msy.km07.completed
- msy.km07Obj02.checkpoint
- msy.km07Obj05.activated
- msy.mission.abort
- msy.mission.aborted
- msy.mission.fail
- msy.mission.failed
- msy.mission.forceabort
- msy.mission.startseq
- msy.objective.fakecomplete
- msy.progress.disable
- msy.progress.enable
- msy.progress.forceshow
- msy.progress.hide
- msy.progress.show
- msy.stronghold.completed
- msy.uniqueChallenge.completed
- mus.adaptivetrack.started
- mus.heatdialogue.play
- mus.trackgroup.shuffle
- open.mouth // Opens the mouth at the Wajah Ramah fortress
- player.scope.reset
- ply.armorpart.acquired
- ply.armorpart.add
- ply.basejump
- ply.basejump.record
- ply.blackmarket.item_fully_upgraded
- ply.blackmarket.item_ordered
- ply.damaged
- ply.doubletether.objects
- ply.doubletether.vehicles
- ply.driverseat_entered
- ply.dualwield
- ply.enter_vehicle
- ply.falling
- ply.grappling.disable // Disables grappling hook.
- ply.grappling.enable // Enables grappling hook.
- ply.grenade.picked_up
- ply.health.upgrade
- ply.heat.increased
- ply.hijack
- ply.hit_character_autotarget
- ply.hit_character_directtarget
- ply.hitbyexplosion
- ply.inflictdamage
- ply.input.disable
- ply.input.enable
- ply.inventory.clear
- ply.invulnerable // Stops weapons, explosions, and drowning from harming the player. Same thing as ply.makeinvulnerable.
- ply.jump
- ply.kill.dualhook
- ply.killed
- ply.killed_civilian
- ply.killed_civilian_from_vehicle
- ply.killed_enemy
- ply.killed_enemy_drag
- ply.killed_enemy_fall
- ply.killed_enemy_from_foot
- ply.killed_enemy_from_vehicle
- ply.killed_enemy_headshot
- ply.killed_enemy_juggle
- ply.killed_enemy_pinata
- ply.killed_enemy_suspended
- ply.killed_enemy_tetherkill
- ply.killed_enemy_with_explosion
- ply.killed_enemy_with_kick
- ply.killed_enemy_with_minigun
- ply.killed_enemy_with_vehicle
- ply.killed_enemy_wreckingball
- ply.makeinvulnerable // Stops weapons, explosions, and drowning from harming the player.
- ply.makevulnerable // Makes things harm the player again.
- ply.money.add // Adds a cash stash. ($2500)
- ply.money.earned // Nothing.
- ply.on_foot // Nothing.
- ply.on_reset // Nothing.
- ply.open_parachute // Nothing.
- ply.parachute.closenow // Makes Rico's parachute disappear when parachuting. Only visual.
- ply.parachute.disable // Disables parachute.
- ply.parachute.enable // Enables parachute.
- ply.parachute_knock // Nothing.
- ply.pause // Makes Rico disappear.
- ply.predator.awesomeness // Makes Rico go "Yyyyeaaaah!"
- ply.ragdoll.getup // Nothing.
- ply.reacthitfly // Made Rico go "Gah!" from pain. Only works once, or something.
- ply.reacttohit // Nothing.
- ply.reeled_in // Nothing.
- ply.reelin // Nothing.
- ply.reelin_land // Nothing.
- ply.rooftop_entered // Nothing.
- ply.skydive // Nothing.
- ply.slingshot // Nothing.
- ply.stunt_jump_to_vehicle // Crash.
- ply.tireshot // Nothing.
- ply.unpause // Makes Rico reappear after calling ply.pause
- ply.valkyrie.awesomeness // Makes Rico hum Ride of the Valkyries.
- ply.vehicle.burn // Sets your car on fire. It will explode like normal.
- ply.vehiclepart.acquired // Adds to statistic but otherwise doesn't work.
- ply.vehiclepart.add // Adds a vehicle part.
- ply.vulnerable // Makes things harm the player again. Same thing as ply.makevulnerable.
- ply.weapon.picked_up // "That'll come in handy"
- ply.weaponpart.acquired // Adds to statistic but otherwise doesn't work.
- ply.weaponpart.add // Adds a weapon part.
- savemanager.save.remove
- savemanager.save.validate
- snd.helicopter.departing
- sht.start.count.01
- sht.start.count.02
- tel.cutscene.end
- tel.cutscene.start
- tut.explosives.ammo
- tut.explosives.noammo
- tut.heli.cling
- tut.hijack.driver
- tut.hijack.guards
- tut.settlement.enter
- tut.triggered.explode
- tut.triggered.place
- tut.triggered.throw
- tut.weapon.ammo
- tut.weapon.dualwield
- tut.weapon.noammo
- tut.weapon.picked
- video.capture.cancel
- video.capture.pause
- video.capture.resume
- video.capture.start
- video.capture.stop
- video.xmb.upload
- video.youtube.upload
Lost Island
- f2m06.emp.explode // Causes the EMP to explode. It will still function, and will be repaired if you leave the area.
- f2m06.EMPBall.boom // Causes the EMP to fire. Does not seem to destroy vehicles, and makes no sound.
Wajah Ramah Fortress / Into the Den Single Player Mission
- mouth.open // Opens the mouth under the three heads
- km06.domeHatch.open // Opens the top of the dome inside the fortress
- km06.domeHatch.close // closes the top of the dome
- km06.cutscene.km06_06.timer.play // Explosion out of the entrance to the fortress, designed to be used in conjunction with the event below
- cot.startSequenceMissionComplete // Collapses the dome of the fortress
Fry Me to the Moon / Satellite Rocket Launch Interception
- msy.f3m04Obj02.completed
- f3m04.rocket2.completed
- f3m04.rocket3.completed
- msy.f3m04Obj01.activated
- f3m04.ricoArrival
- t{sps.rocket2({2B7BCAE2-47F0-4D91-8C6D-E23F21E7386F})}::event
- t{sps.rocket1({7E294028-FB84-47B0-8027-9ED9EAAE60F8})}::event
- evt.t{mod.weaponstash.triggered({932BA80C-88E3-4128-97E1-19AB17F88C49})}::weapon.pickup/local::respawn.timer.start
- t{mod.weaponstash.triggered({932BA80C-88E3-4128-97E1-19AB17F88C49})}::weapon.pickup
- t{mod.weaponstash.triggered({932BA80C-88E3-4128-97E1-19AB17F88C49})}::respawn.timer.start
- f3m04.allSatellitesDestroyed
- msy.f3m04Obj03.activated
- f3m04.rocket04Destroyed
- f3m04.satellite01Destroyed
- f3m04.satellite04Destroyed
- f3m04.countdownStart
- msy.f3m04.complete
- f3m04.tinOffX
- f3m04.plane01Destroyed
- f3m04.plane.exit
- f3m04.rocket04BlastOffReady
- msy.f3m04Obj03.checkpoint
- f3m04.mut.satellite04Destroyed.play
- f3m04.enterPlane01
- f3m04.enterPlane02
- f3m04.satellite04Destroyed
- f3m04.rocket04BlastOffReady
- f3m04.rocket04BlastOff
- f3m04.rocket03Spawned
- t{sps.plane({E0228390-1BD0-46B0-A7FB-DF44C5DBADA8})}::showTin
- t{sps.plane({E0228390-1BD0-46B0-A7FB-DF44C5DBADA8})}::spawned
- f3m04_bolo_f_xx_11.complete